import Api from "@/Api/index";
import config from "@/config/index";

export default class HomeService{

    async getHome(data= []){
        console.log(1)
       return await (new Api()).get({
            url:config.apiList.categories_list,
            data:""
        })
    }

    //请求阿里云身份token
    async token (data = {}, headers = {}) {
        return await (new Api).post({
            url: config.apiList.token,
            data,
            headers
        })
    }

    //上传的阿里云
    async uploadFile (data = {}, headers = {}) {
        return await (new Api("noBaseUrl")).post({
            url: config.aliOss.host,
            data,
            headers
        })
    }

    //发布
    async push (data = {}, headers = {}) {
        return await (new Api).post({
            url: config.apiList.push,
            data,
            headers
        })
    }

    async tab (data = {}, headers = {}) {
        return await (new Api).post({
            url: config.apiList.tab,
            data,
            headers
        })
    }
}